import requset from './request'
export const getAvailData = (data) => requset({
  method: 'POST',
  url: '/avail/findAvail',
  params: {
    pageNum: data.pageNum,
    pageSize: data.pageSize
  },
  data
})

export const getTable2Data = (data) => requset({
  url: '/break/findBreak',
  params: data
})

export const getTable3Data = (data) => requset({
  url: '/delay/findDelay',
  params: data
})

export const getDelayAmpData = (data) => requset({
  method: 'POST',
  url: '/delayAmp/findDelayAmp',
  params: {
    pageNum: data.pageNum,
    pageSize: data.pageSize
  },
  data
})

export const getBreakData = (data) => requset({
  method: 'POST',
  url: '/break/findBreak',
  params: {
    pageNum: data.pageNum,
    pageSize: data.pageSize
  },
  data
})

export const getAlermData = (data) => requset({
  method: 'POST',
  url: '/areaBreakDelay/findAreaBreakDelay',
  data
})

export const exportBreak = (data) => requset({
  method: 'POST',
  url: '/break/exportBreak',
  data
})

export const getMampData = (data) => requset({
  method: 'POST',
  url: '/mamp/findMamp',
  params: {
    pageNum: data.pageNum,
    pageSize: data.pageSize
  },
  data
})

export function getNetCode () {
  return requset({
    url: '/netStaCatalog/fetchAllNetCode'
  })
}

export function exportAvail (data) {
  return requset({
    url: '/avail/exportAvail',
    method: 'post',
    data
  })
}

// 获取所有台网码
export function getAllNetCode () {
  return requset({
    url: '/netStaCatalog/fetchAllNetCode'
  })
}

// 获取所有位置号
export function getAllChanNum () {
  return requset({
    url: '/netStaCatalog/fetchAllChanNum'
  })
}

// 获取所有通道码
export function getAllChanCode () {
  return requset({
    url: '/netStaCatalog/fetchAllChanCode'
  })
}

// 根据台网码筛选台站数据
export function findStationFilteredByNetCode (params) {
  return requset({
    url: '/netStaCatalog/fetchAllChanCode',
    params // netCode
  })
}
export const getDelayData = (data) => requset({
  method: 'POST',
  url: '/delay/findDelay',
  params: {
    pageNum: data.pageNum,
    pageSize: data.pageSize
  },
  data
})

// 断记详细信息
export function getBreakDetail (data) {
  return requset({
    url: '/breakDetail/findBreakDetail',
    method: 'POST',
    params: {
      pageNum: data.pageNum,
      pageSize: data.pageSize
    },
    data
  })
}

// 采样率变换超标(采样率告警)
export function getActiveAlarm (data) {
  return requset({
    url: '/activeAlarm/findActiveAlarm',
    method: 'POST',
    params: {
      pageNum: data.pageNum,
      pageSize: data.pageSize
    },
    data
  })
}

// 获取所有台站类型
export function getAllStaType (data) {
  return requset({
    url: '/netStaCatalog/fetchAllStaType'
  })
}

export const exportDelay = (data) => requset({
  method: 'POST',
  url: '/delay/exportDelay',
  data
})

export const exportDelayAmp = (data) => requset({
  method: 'POST',
  url: '/delayAmp/exportDelayAmp',
  data
})

export const getOfflineData = (data) => requset({
  method: 'POST',
  url: '/offline/findOffline',
  params: {
    pageNum: data.pageNum,
    pageSize: data.pageSize
  },
  data
})

export const exportBreakWord = (data) => requset({
  method: 'POST',
  url: '/word/generateBreakWord',
  responseType: 'blob',
  data
})

export function fetchAllInfo (params) {
  return requset({
    url: '/netStaCatalog/fetchAllInfo',
    params
  })
}
export const exportDelayAmpWord = (data) => requset({
  method: 'POST',
  url: '/word/generateDelayAmpWord',
  responseType: 'blob',
  data
})
export const exportDelayWord = (data) => requset({
  method: 'POST',
  url: '/word/generateDelayWord',
  responseType: 'blob',
  data
})
export const exportAvailWord = (data) => requset({
  method: 'POST',
  url: '/word/generateAvailWord',
  responseType: 'blob',
  data
})
